<template>
  <a-modal
    title="确认取消"
    :maskClosable="false"
    :destroyOnClose="true"
    centered
    :width="400"
    v-model="visible"
    @ok="handleSubmit"
  >
    <div>
      <div>确认关闭后，将通过消息告知合作组织</div>
    </div>
  </a-modal>
</template>

<script>
import { CooperationCancel } from '@/api/business/cooperation'
export default {
  data() {
    return {
      visible: false,
      id: undefined,
    }
  },
  methods: {
    show(id) {
      this.id = id
      this.visible = true
    },
    async handleSubmit() {
      let { code, msg } = await CooperationCancel({ id: this.id })
      this.$message[code === 0 ? 'success' : 'error'](msg)
      if (code === 0) this.$emit('success')
      this.visible = false
    },
  },
}
</script>

<style lang="less" scoped>
.content {
  padding-bottom: 20px;
}

.line1 {
  display: flex;
  align-items: center;
  .logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
  }
  .name {
    font-size: 16px;
    font-weight: bold;
    margin-left: 10px;
  }
}
.line2 {
  color: #999;
}
.line3 {
  .item {
    padding: 5px 10px;
    border: 1px #ccc solid;
    margin-right: 10px;
    border-radius: 5px;
  }
}
.line4 {
  font-weight: bold;
}
.mb20 {
  margin-bottom: 20px;
}
</style>